/**
 * @description: 防抖
 * @param {*} callback
 * @param {*} time
 */
export function debounce(callback, time = 1000) {
    let timeId = null;
    return function (...args) {
      if (timeId !== null) {
        // 清空定时器
        clearTimeout(timeId);
      }
      timeId = setTimeout(() => {
        callback.call(this, ...args);
        timeId = null;
      }, time);
    };
  }
  